<template>
    <div style="width:100vw;height:100vh">
        <div id="main" style="width: 50%;height:80%;"></div>
    </div>
</template>

<script>
export default {
    data() {
        return {

        };
    },
    computed: {

    },
    created() {

    },
    mounted() {
        var myChart = this.$myEcharts('main')

        // 指定图表的配置项和数据
        var option = {
            title: {
                text: 'ECharts 入门示例'
            },
            tooltip: {},
            legend: {
                data: ['one', 'two', 'three', 'four', 'five']
            },
            xAxis: {
                name: 'x轴',
                data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子'],
                nameTextStyle: { color: 'blue', fontSize: 20, align: 'center' },
                nameGap: 25,
                nameLocation: 'center',
            },
            yAxis: {
                axisLine: {
                    show: true, symbol: 'arrow', symbolSize: [5, 8], symbolOffset: [-5, 10], lineStyle: {
                        color: '#000', type: 'solid',
                    },

                },
                axisTick: { show: true, inside: true },
                axisLabel: { show: true, formatter: '{value} kg' },
                name: 'y轴',
                nameLocation: 'center',
                nameTextStyle: { color: 'blue', fontSize: 20, align: 'center' },
                nameGap: 38,
            },
            series: [
                {
                    name: 'one',
                    type: 'line',
                    data: [5, 20, 36, 10, 12, 20]
                },
                {
                    name: 'two',
                    type: 'pie',
                    data: [5, 20, 36, 10, 12, 20],
                    type: 'pie',
                    left: 400,
                    top: 0,
                    width: 200,
                    height: 200,
                    labelLine: { show: false }
                },
                {
                    name: 'three',
                    type: 'bar',
                    data: [15, 10, 26, 18, 30, 24]
                },
                {
                    name: 'four',
                    type: 'line',
                    data: [20, 8, 16, 35, 17, 14]
                },
                {
                    name: 'five',
                    type: 'bar',
                    data: [5, 20, 36, 10, 12, 20]
                }
            ]
        };

        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);

        window.onresize = function () {
            myChart.resize();
        };
    },
    watch: {

    },
    methods: {

    },
    components: {

    },
};
</script>

<style scoped>
</style>
